{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# ArbitraryDiscretiser\n",
    "\n",
    "The ArbitraryDiscretiser() divides continuous numerical variables into contiguous intervals are arbitrarily entered by the user.\n",
    "\n",
    "The user needs to enter a dictionary with variable names as keys, and a list of the limits of the intervals as values. For example {'var1': [0, 10, 100, 1000], 'var2': [5, 10, 15, 20]}.\n",
    "\n",
    "**Note**\n",
    "\n",
    "For this demonstration, we use the Ames House Prices dataset produced by Professor Dean De Cock:\n",
    "\n",
    "Dean De Cock (2011) Ames, Iowa: Alternative to the Boston Housing\n",
    "Data as an End of Semester Regression Project, Journal of Statistics Education, Vol.19, No. 3\n",
    "\n",
    "http://jse.amstat.org/v19n3/decock.pdf\n",
    "\n",
    "https://www.tandfonline.com/doi/abs/10.1080/10691898.2011.11889627\n",
    "\n",
    "The version of the dataset used in this notebook can be obtained from [Kaggle](https://www.kaggle.com/c/house-prices-advanced-regression-techniques/data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "from feature_engine.discretisation import ArbitraryDiscretiser\n",
    "plt.rcParams[\"figure.figsize\"] = [15,5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Id</th>\n",
       "      <th>MSSubClass</th>\n",
       "      <th>MSZoning</th>\n",
       "      <th>LotFrontage</th>\n",
       "      <th>LotArea</th>\n",
       "      <th>Street</th>\n",
       "      <th>Alley</th>\n",
       "      <th>LotShape</th>\n",
       "      <th>LandContour</th>\n",
       "      <th>Utilities</th>\n",
       "      <th>...</th>\n",
       "      <th>PoolArea</th>\n",
       "      <th>PoolQC</th>\n",
       "      <th>Fence</th>\n",
       "      <th>MiscFeature</th>\n",
       "      <th>MiscVal</th>\n",
       "      <th>MoSold</th>\n",
       "      <th>YrSold</th>\n",
       "      <th>SaleType</th>\n",
       "      <th>SaleCondition</th>\n",
       "      <th>SalePrice</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>60</td>\n",
       "      <td>RL</td>\n",
       "      <td>65.0</td>\n",
       "      <td>8450</td>\n",
       "      <td>Pave</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Reg</td>\n",
       "      <td>Lvl</td>\n",
       "      <td>AllPub</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2008</td>\n",
       "      <td>WD</td>\n",
       "      <td>Normal</td>\n",
       "      <td>208500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>20</td>\n",
       "      <td>RL</td>\n",
       "      <td>80.0</td>\n",
       "      <td>9600</td>\n",
       "      <td>Pave</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Reg</td>\n",
       "      <td>Lvl</td>\n",
       "      <td>AllPub</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>2007</td>\n",
       "      <td>WD</td>\n",
       "      <td>Normal</td>\n",
       "      <td>181500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>60</td>\n",
       "      <td>RL</td>\n",
       "      <td>68.0</td>\n",
       "      <td>11250</td>\n",
       "      <td>Pave</td>\n",
       "      <td>NaN</td>\n",
       "      <td>IR1</td>\n",
       "      <td>Lvl</td>\n",
       "      <td>AllPub</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>2008</td>\n",
       "      <td>WD</td>\n",
       "      <td>Normal</td>\n",
       "      <td>223500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>70</td>\n",
       "      <td>RL</td>\n",
       "      <td>60.0</td>\n",
       "      <td>9550</td>\n",
       "      <td>Pave</td>\n",
       "      <td>NaN</td>\n",
       "      <td>IR1</td>\n",
       "      <td>Lvl</td>\n",
       "      <td>AllPub</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2006</td>\n",
       "      <td>WD</td>\n",
       "      <td>Abnorml</td>\n",
       "      <td>140000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>60</td>\n",
       "      <td>RL</td>\n",
       "      <td>84.0</td>\n",
       "      <td>14260</td>\n",
       "      <td>Pave</td>\n",
       "      <td>NaN</td>\n",
       "      <td>IR1</td>\n",
       "      <td>Lvl</td>\n",
       "      <td>AllPub</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>12</td>\n",
       "      <td>2008</td>\n",
       "      <td>WD</td>\n",
       "      <td>Normal</td>\n",
       "      <td>250000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 81 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   Id  MSSubClass MSZoning  LotFrontage  LotArea Street Alley LotShape  \\\n",
       "0   1          60       RL         65.0     8450   Pave   NaN      Reg   \n",
       "1   2          20       RL         80.0     9600   Pave   NaN      Reg   \n",
       "2   3          60       RL         68.0    11250   Pave   NaN      IR1   \n",
       "3   4          70       RL         60.0     9550   Pave   NaN      IR1   \n",
       "4   5          60       RL         84.0    14260   Pave   NaN      IR1   \n",
       "\n",
       "  LandContour Utilities  ... PoolArea PoolQC Fence MiscFeature MiscVal MoSold  \\\n",
       "0         Lvl    AllPub  ...        0    NaN   NaN         NaN       0      2   \n",
       "1         Lvl    AllPub  ...        0    NaN   NaN         NaN       0      5   \n",
       "2         Lvl    AllPub  ...        0    NaN   NaN         NaN       0      9   \n",
       "3         Lvl    AllPub  ...        0    NaN   NaN         NaN       0      2   \n",
       "4         Lvl    AllPub  ...        0    NaN   NaN         NaN       0     12   \n",
       "\n",
       "  YrSold  SaleType  SaleCondition  SalePrice  \n",
       "0   2008        WD         Normal     208500  \n",
       "1   2007        WD         Normal     181500  \n",
       "2   2008        WD         Normal     223500  \n",
       "3   2006        WD        Abnorml     140000  \n",
       "4   2008        WD         Normal     250000  \n",
       "\n",
       "[5 rows x 81 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = pd.read_csv('housing.csv')\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_train : (1022, 79)\n",
      "X_test : (438, 79)\n"
     ]
    }
   ],
   "source": [
    "# let's separate into training and testing set\n",
    "X = data.drop([\"Id\", \"SalePrice\"], axis=1)\n",
    "y = data.SalePrice\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(\n",
    "    X, y, test_size=0.3, random_state=0)\n",
    "\n",
    "print(\"X_train :\", X_train.shape)\n",
    "print(\"X_test :\", X_test.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2cAAAE/CAYAAADCCbvWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAepElEQVR4nO3df7Cld10f8PfHBBIkKIkh65KkbGhTK5gS6E6M0qG3BE0gjomOOLEBNpbOtiMi1nRgI46/pumktjrQUbQpoEv5EcMPJzsEq2nwjmPFRH6EH0mICbCQJUsWUIRlbOzCp3+cZ/WyuXfvPXfvj+fe+3rNnDnnfM/znPM9nz33Pve93+/zPdXdAQAAYH1903p3AAAAAOEMAABgFIQzAACAERDOAAAARkA4AwAAGAHhDAAAYASEM1hEVR2uqqeudz8AANjchDM2paq6qqruqKqvVtWh4fZPVFUtsP3vVNV/nO+x7j6tuz85xWtfU1VdVT+63P4DwEZSVfur6nlTbD9TVQcWeMxxlC1LOGPTqaprk7w2yX9J8u1JtiX5d0meneSx82x/0gp3YVeSvxyuj9fPk1f4dQFgM3AcZcsSzthUqupbk/xykp/o7nd091d64kPdfXV3PzKMkv1mVb2nqr6a5F8u8pxdVf+oqi6uqs/NDXNV9UNV9ZE595+S5F8k2Z3k0qraNuexmao6UFWvqqrPJfntqvqmqtpTVZ+oqi9W1c1Vdcacfd4+vOZfV9UfV9XTV6xYALCKquqUqnpNVT00XF4ztD0+ye8nefJw6sDhqnrysI/jKFuacMZm8z1JTklyyyLb/ask1yd5QpI/Wco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zbRLNhWNFzsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 1080x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# we will discretise two continuous variables\n",
    "\n",
    "X_train[[\"LotArea\", 'GrLivArea']].hist(bins=50)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The ArbitraryDiscretiser() works only with numerical variables. The discretiser will\n",
    "check if the dictionary entered by the user contains variables present in the\n",
    "training set, and if these variables are cast as numerical, before doing any\n",
    "transformation.\n",
    "\n",
    "Then it transforms the variables, that is, it sorts the values into the intervals,\n",
    "transform."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "ArbitraryDiscretiser(binning_dict={'GrLivArea': [-inf, 500, 1000, 1500, 2000,\n",
       "                                                 2500, inf],\n",
       "                                   'LotArea': [-inf, 4000, 8000, 12000, 16000,\n",
       "                                               20000, inf]},\n",
       "                     return_boundaries=False, return_object=False)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "Parameters\n",
    "----------\n",
    "\n",
    "binning_dict : dict\n",
    "    The dictionary with the variable : interval limits pairs, provided by the user.\n",
    "    A valid dictionary looks like this:\n",
    "\n",
    "     binning_dict = {'var1':[0, 10, 100, 1000], 'var2':[5, 10, 15, 20]}.\n",
    "\n",
    "return_object : bool, default=False\n",
    "    Whether the numbers in the discrete variable should be returned as\n",
    "    numeric or as object. The decision is made by the user based on\n",
    "    whether they would like to proceed the engineering of the variable as\n",
    "    if it was numerical or categorical.\n",
    "\n",
    "return_boundaries: bool, default=False\n",
    "    whether the output should be the interval boundaries. If True, it returns\n",
    "    the interval boundaries. If False, it returns integers.\n",
    "'''\n",
    "\n",
    "atd = ArbitraryDiscretiser(binning_dict={\"LotArea\":[-np.inf,4000,8000,12000,16000,20000,np.inf],\n",
    "                                        \"GrLivArea\":[-np.inf,500,1000,1500,2000,2500,np.inf]})\n",
    "\n",
    "atd.fit(X_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'LotArea': [-inf, 4000, 8000, 12000, 16000, 20000, inf],\n",
       " 'GrLivArea': [-inf, 500, 1000, 1500, 2000, 2500, inf]}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# binner_dict contains the boundaries of the different bins\n",
    "atd.binner_dict_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_t = atd.transform(X_train)\n",
    "test_t = atd.transform(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[4 2 1 0 3 5]\n",
      "[2 0 1 3 5 4]\n"
     ]
    }
   ],
   "source": [
    "# the below are the bins into which the observations were sorted\n",
    "print(train_t['GrLivArea'].unique())\n",
    "print(train_t['LotArea'].unique())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>LotArea</th>\n",
       "      <th>GrLivArea</th>\n",
       "      <th>LotArea_binned</th>\n",
       "      <th>GrLivArea_binned</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>9375</td>\n",
       "      <td>2034</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>682</th>\n",
       "      <td>2887</td>\n",
       "      <td>1291</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>960</th>\n",
       "      <td>7207</td>\n",
       "      <td>858</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1384</th>\n",
       "      <td>9060</td>\n",
       "      <td>1258</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1100</th>\n",
       "      <td>8400</td>\n",
       "      <td>438</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      LotArea  GrLivArea  LotArea_binned  GrLivArea_binned\n",
       "64       9375       2034               2                 4\n",
       "682      2887       1291               0                 2\n",
       "960      7207        858               1                 1\n",
       "1384     9060       1258               2                 2\n",
       "1100     8400        438               2                 0"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# here I put side by side the original variable and the transformed variable\n",
    "tmp = pd.concat([X_train[[\"LotArea\", 'GrLivArea']], train_t[[\"LotArea\", 'GrLivArea']]], axis=1)\n",
    "tmp.columns = [\"LotArea\", 'GrLivArea',\"LotArea_binned\", 'GrLivArea_binned']\n",
    "tmp.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA3sAAAFKCAYAAACkdEbCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhc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0kAHgReS9M99A+SXA/cSpNsJvND4KAk1wA/4OHjIqakqm5K8g7gojR3Df0ZcEJVfS3JO2mS6N003U8Heic1SdLQ7DQmD76XJt/9U5KdgNuB17fzzmrbf0xzMnO8XHgu8K7exk3km6/T9Mq5HfhKH/Hu0N70ZRu2QgFWVWuTvA74RJId2uZ3VNU309w87YIk36E5yfrkLd2fNFVpuhNLkiRJkrrEbpySJEmS1EF245Q6oO2assOY5mOq6oZhxCNJ0nRLch6w/5jmk6rqi8OIRxoFduOUJEmSpA6yG6ckSZIkdZDFniRJkiR1kMWeJEmSJHWQxZ4kSZIkdZDFniRJkiR10P8PtBgaI8lDPEMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 1080x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.subplot(1,2,1)\n",
    "tmp.groupby('GrLivArea_binned')['GrLivArea'].count().plot.bar()\n",
    "plt.ylabel('Number of houses')\n",
    "plt.title('Number of observations per bin')\n",
    "plt.subplot(1,2,2)\n",
    "tmp.groupby('LotArea_binned')['LotArea'].count().plot.bar()\n",
    "plt.ylabel('Number of houses')\n",
    "plt.title('Number of observations per bin')\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Now return interval boundaries instead"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "ArbitraryDiscretiser(binning_dict={'GrLivArea': [-inf, 500, 1000, 1500, 2000,\n",
       "                                                 2500, inf],\n",
       "                                   'LotArea': [-inf, 4000, 8000, 12000, 16000,\n",
       "                                               20000, inf]},\n",
       "                     return_boundaries=True, return_object=False)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "atd = ArbitraryDiscretiser(binning_dict={\"LotArea\": [-np.inf, 4000, 8000, 12000, 16000, 20000, np.inf],\n",
    "                                         \"GrLivArea\": [-np.inf, 500, 1000, 1500, 2000, 2500, np.inf]},\n",
    "                           # to return the boundary limits\n",
    "                           return_boundaries=True)\n",
    "\n",
    "atd.fit(X_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_t = atd.transform(X_train)\n",
    "test_t = atd.transform(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([Interval(-inf, 500.0, closed='right'),\n",
       "       Interval(500.0, 1000.0, closed='right'),\n",
       "       Interval(1000.0, 1500.0, closed='right'),\n",
       "       Interval(1500.0, 2000.0, closed='right'),\n",
       "       Interval(2000.0, 2500.0, closed='right'),\n",
       "       Interval(2500.0, inf, closed='right')], dtype=object)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# the numbers are the different bins into which the observations\n",
    "# were sorted\n",
    "np.sort(np.ravel(train_t['GrLivArea'].unique()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([Interval(500.0, 1000.0, closed='right'),\n",
       "       Interval(1000.0, 1500.0, closed='right'),\n",
       "       Interval(1500.0, 2000.0, closed='right'),\n",
       "       Interval(2000.0, 2500.0, closed='right'),\n",
       "       Interval(2500.0, inf, closed='right')], dtype=object)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sort(np.ravel(test_t['GrLivArea'].unique()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAFfCAYAAAChhtABAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmU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ken7wPdHTw4naX/gGNtLVRNZZ0jaB3gfsB6wDMXQ1B9TLMf5pwpDq70khailYRhdFdEN6T6Kuqr16KrxSHpT1TF0S53r1i/SUohaqvvoqvFIutP2tInfOXjqXLd+kaQQtVfH0VWSzmm1CdjG9sDOEVTnug2CDEmN2ivXTphfdRwd9lrg3cCfR5WLYnGaQVbnuvW9JIWIwXQZ8LjtS0ZvkHRTBfF0Up3r1vfSfRQREQ0ZfRQxgMqZbSf9nn5U57oNgiSFiMFU5yG3da5b30v3UcQAajHkdllgCQZ8yG2d6zYIkhQiBlwdh9yOqHPd+lWSQkRENOSaQkRENCQpREREQ5JCREQ0JClERETD/wc56EnJiHnsKAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# bar plot to show the intervals returned by the transformer\n",
    "test_t.LotArea.value_counts(sort=False).plot.bar(figsize=(6,4))\n",
    "plt.ylabel('Number of houses')\n",
    "plt.title('Number of houses per interval')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "fengine",
   "language": "python",
   "name": "fengine"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
